<template>
  <div class="container-com-title">
    <div class="title">
      <span v-if="btnBack">
        <el-button size="mini" plain @click="router.back()">返回</el-button>
      </span>
      <span v-if="btnBackIcon">
        <i class="el-icon-back" @click="router.back()" />
      </span>
      {{ text }}
    </div>
  </div>
</template>

<script>
import router from '@/router';

export default {
  name: 'PageHeader',
  props: {
    text: String,
    btnBack: Boolean,
    btnBackIcon: Boolean,
  },
  setup() {
    return {
      router,
    };
  },
};
</script>

<style lang="less" scoped>
.container-com-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  .title {
    padding: 10px 0;
    border-bottom: 1px solid #EBEEF5;
  }
  .el-icon-back {
    cursor: pointer;
  }
}
</style>
